<!DOCTYPE html>
<html>
<head>
    <title>Animated Geometry Login</title>
    <style>
        body { 
            margin: 0; 
            overflow: hidden; 
            background: #000;
        }
        .login-box {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0, 0, 0, 0.7);
            padding: 20px;
            border-radius: 10px;
            color: white;
            text-align: center;
            z-index: 100;
        }
        input, button {
            display: block;
            margin: 10px auto;
            padding: 8px;
            width: 200px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid #555;
            color: white;
        }
    </style>
</head>
<body>
    <div class="login-box">
        <h2>Geometry Login</h2>
        <input type="text" placeholder="Username">
        <input type="password" placeholder="Password">
        <button>Login</button>
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
    <script>
        // 初始化场景
        const scene = new THREE.Scene();
        
        // 相机设置
        const camera = new THREE.PerspectiveCamera(
            75, 
            window.innerWidth / window.innerHeight, 
            0.1, 
            1000
        );
        camera.position.z = 5;

        // 渲染器
        const renderer = new THREE.WebGLRenderer({ 
            antialias: true,
            alpha: true
        });
        renderer.setSize(window.innerWidth, window.innerHeight);
        document.body.appendChild(renderer.domElement);

        // 创建动态几何体
        let geometry = new THREE.IcosahedronGeometry(1, 2);
        let material = new THREE.MeshNormalMaterial({ 
            flatShading: true,
            transparent: true,
            opacity: 0.8
        });
        let mesh = new THREE.Mesh(geometry, material);
        scene.add(mesh);

        // 添加环境光
        const ambientLight = new THREE.AmbientLight(0x404040);
        scene.add(ambientLight);

        // 动画循环
        function animate() {
            requestAnimationFrame(animate);
            
            // 动态变形
            mesh.rotation.x += 0.005;
            mesh.rotation.y += 0.01;
            
            // 脉动效果
            const time = Date.now() * 0.001;
            mesh.scale.set(
                Math.sin(time) * 0.3 + 1,
                Math.cos(time * 0.8) * 0.3 + 1,
                1
            );
            
            renderer.render(scene, camera);
        }
        animate();

        // 响应窗口大小变化
        window.addEventListener('resize', () => {
            camera.aspect = window.innerWidth / window.innerHeight;
            camera.updateProjectionMatrix();
            renderer.setSize(window.innerWidth, window.innerHeight);
        });
    </script>
</body>
</html>